package kr.co.ham.common;

import java.io.File;
import java.io.FilenameFilter;
import java.util.regex.Pattern;

public class ImgFileFilter implements FilenameFilter {
	  private String extensions = "(bmp|gif|jpg|jpeg|png)"; 
	  private Pattern pattern = Pattern.compile( ".+[.]" + extensions, Pattern.CASE_INSENSITIVE);

	  
	  @Override
	  public boolean accept(File directory, String filename) {
	    return pattern.matcher(filename).matches();
	  }
}
